<?php
/**
 * This page maps User Aliases to usernames and displays their user page
 * Found at /user/([a-zA-Z0-9_]+)
 * 
 * This page can only be accessed using mod_rewrite.
 */

    require_once('../SiteIncludes.GLOBAL.php');
    
    if(EclipseMDE::runningOnMod_Rewrite() === false) {
	// Security Guard, Do Not Let This be accessed by any other means than mod_rewrite
	$gVAR['e'] = '404';
	require_once('error_handler.php');
    }
    
    
    try {
	if(isset($gVAR['alias'])) {
	    $User =& $UserStash->get($gVAR['alias']);
	    
	    
	    
	    $TemplateEngine->render();
	} else {
	    throw new InvalidUserException();
	}
    } catch(InvalidUserException $e) {
	// Error Page for no user
	$gVAR['e'] = '404';
	require_once('error_handler.php');
    }
    
?>